// MESSAGE ACC_DATA support class

#pragma once

namespace mavlink {
namespace rams_msg {
namespace msg {

/**
 * @brief ACC_DATA message
 *
 * Test all field types
 */
struct ACC_DATA : mavlink::Message {
    static constexpr msgid_t MSG_ID = 919;
    static constexpr size_t LENGTH = 32;
    static constexpr size_t MIN_LENGTH = 32;
    static constexpr uint8_t CRC_EXTRA = 106;
    static constexpr auto NAME = "ACC_DATA";


    double time; /*<  time */
    std::array<double, 3> acc; /*<  acc_array */


    inline std::string get_name(void) const override
    {
            return NAME;
    }

    inline Info get_message_info(void) const override
    {
            return { MSG_ID, LENGTH, MIN_LENGTH, CRC_EXTRA };
    }

    inline std::string to_yaml(void) const override
    {
        std::stringstream ss;

        ss << NAME << ":" << std::endl;
        ss << "  time: " << time << std::endl;
        ss << "  acc: [" << to_string(acc) << "]" << std::endl;

        return ss.str();
    }

    inline void serialize(mavlink::MsgMap &map) const override
    {
        map.reset(MSG_ID, LENGTH);

        map << time;                          // offset: 0
        map << acc;                           // offset: 8
    }

    inline void deserialize(mavlink::MsgMap &map) override
    {
        map >> time;                          // offset: 0
        map >> acc;                           // offset: 8
    }
};

} // namespace msg
} // namespace rams_msg
} // namespace mavlink
